/*
*	Developed by Leonardo Chatain and Pedro Dusso, at Universidade Federal do Rio Grande do Sul, Brasil, 2009/1
*	Source available at glpacman.codeplex.com
*/

#pragma once
#ifndef _MAZE_H_
#define _MAZE_H_

#include <iostream>
#include <GL/glut.h>
#include "TextureLoader.h"
#include "Definitions.h"
#include "Point2D.h"
#include "TextureLoader.h"

using namespace std;

typedef GLfloat PontoXYZ[3];

class Maze
{
private:
	char **maze;
	int lines;
	int columns;
	Point2D pacStart;
	Point2D *phantomStart;
	int nPhantoms;
	int nPills;

	void drawSkyBox();
	void drawRoof();
	void drawFloor();
	void drawWall();
	void drawPill();
	void drawSuperPill();

	glTexture wallTex;
	glTexture upWallTex;
	glTexture floorTex;
	glTexture planet1Tex;
	glTexture planet2Tex;
	glTexture planet3Tex;
	glTexture planet4Tex;
	TextureLoader texLoader;

public:
	Maze(void);
	~Maze(void);

	void openMaze(const char* path);
	void draw();

	// Getters and Setters
	inline int getLines() { return lines; }
	inline int getColumns() { return columns; }
	inline char **getMaze() { return maze; }
	inline Point2D getPacStart() { return pacStart; }
	inline void setMazePos(char c, int line, int column) { maze[line][column] = c; }
	inline Point2D *getPhantomStart() { return phantomStart; }
	inline int getNPhantoms() { return nPhantoms; }
	inline int getNPills() { return nPills; }
	inline void setNPills(int p) { nPills = p; }
	inline void decrementNPills() { nPills--; }
};


#endif